<?php

namespace qore_base\base;

abstract class Printable {
	
	public function p_Output() {
		$propertyStrings = array();
		foreach ($this as $property => $value) {
			$propertyStrings[] = "$property='".var_export($value, true)."'";
		}
		echo get_class($this).'('.implode(', ', $propertyStrings).')';
	}
	
	public function __toString() {
		ob_start();
		try {
			$this->p_Output();
		} catch (\Exception $e) {
			
		}
		$output = ob_get_clean();
		return $output;
	}
	
}